<template xmlns="http://www.w3.org/1999/html">
    <!--新建-->
    <smart-form-group ref="form_create" method="POST" url="/sys/role/info"
                      :model="form_data" :succeed="props.succeed">
      <smart-form-layout require name="authorityCode" label="授权码">
        <smart-text-view name="authorityCode" placeholder="授权码"></smart-text-view>
      </smart-form-layout>
      <smart-form-layout require name="roleName" label="角色名称">
        <smart-text-view name="roleName" placeholder="角色名称"></smart-text-view>
      </smart-form-layout>
      <smart-form-layout require name="description" label="角色描述">
        <smart-text-view type="textarea" name="description" placeholder="角色描述"></smart-text-view>
      </smart-form-layout>
    </smart-form-group>
</template>

<script setup>

/**
 * 创建页面
 */
const props = defineProps({
    // 成功回调，通常是刷新数据表格
    succeed: {type: Function, default: undefined}
})

// form-data start 表单数据对象模型
const form_data = [
    {
        name: 'id', label: 'ID', value: ''
        , rules: [
            {required: true, message: '[ID]字段不允许为空 ', trigger: 'blur'},
            {min: 0, max: 32, message: '最多32字符', trigger: 'blur'}
        ]
    },
    {
        name: 'orgId', label: '机构ID', value: ''
        , rules: [
            {required: true, message: '[机构ID]字段不允许为空 ', trigger: 'blur'},
            {min: 0, max: 32, message: '最多32字符', trigger: 'blur'}
        ]
    },
    {
        name: 'authorityCode', label: '授权码', value: ''
        , rules: [
            {required: true, message: '[授权码]字段不允许为空 ', trigger: 'blur'},
            {min: 0, max: 32, message: '最多32字符', trigger: 'blur'}
        ]
    },
    {
        name: 'roleName', label: '角色名称', value: ''
        , rules: [
            {required: true, message: '[角色名称]字段不允许为空 ', trigger: 'blur'},
            {min: 0, max: 64, message: '最多64字符', trigger: 'blur'}
        ]
    },
    {
        name: 'icon', label: '', value: ''
        , rules: [
            {required: true, message: '[]字段不允许为空 ', trigger: 'blur'},
            {min: 0, max: 255, message: '最多255字符', trigger: 'blur'}
        ]
    },
    {
        name: 'disabled', label: '是否可用', value: ''
    },
    {
        name: 'editable', label: '是否可编辑', value: ''
    },
    {
        name: 'description', label: '描述', value: ''
        , rules: [
            {required: true, message: '[描述]字段不允许为空 ', trigger: 'blur'},
            {min: 0, max: 128, message: '最多128字符', trigger: 'blur'}
        ]
    },
    {
        name: 'gmtCreate', label: '创建日期', value: ''
    },
    {
        name: 'gmtModified', label: '', value: ''
    },
]
// form-data end
</script>
